home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / cut_past.zip / PASTE.MAN < prev    next >
Text File  |  1987-03-05  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4. PASTE(1)            UNIX Programmer's Manual             PASTE(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      paste - merge same lines of several files or subsequent
  10.      lines of one file
  11.  
  12. SYNOPSIS
  13.      paste file1 file2 ...
  14.      paste -dlist file1 file2 ...
  15.      paste -s [-dlist] file1 file2 ...
  16.  
  17. DESCRIPTION
  18.      In the first two forms, _p_a_s_t_e concatenates corresponding
  19.      lines of the given input files _f_i_l_e_1, _f_i_l_e_2, etc.  It treats
  20.      each file as a column or columns of a table and pastes them
  21.      together horizontally (parallel merging).  If you will, it
  22.      is the counterpart of _c_a_t(1) which concatenates vertically,
  23.      i.e., one file after the other.  In the last form above,
  24.      _p_a_s_t_e replaces the function of an older command with the
  25.      same name by combining subsequent lines of the input file
  26.      (serial merging).  In all cases, lines are glued together
  27.      with the _t_a_b character, or with characters from an option-
  28.      ally specified _l_i_s_t.  Output is to the standard output, so
  29.      it can be used as the start of a pipe, or as a filter, if -
  30.      is used in place of a file name.
  31.  
  32.      The meanings of the options are:
  33.  
  34.      -d   Without this option, the new-line characters of each
  35.           but the last file (or last line in case of the -s
  36.           option) are replaced by a _t_a_b character.  This option
  37.           allows replacing the _t_a_b character by one or more
  38.           alternate characters (see below).
  39.  
  40.      _l_i_s_t One or more characters immediately following -d replace
  41.           the default _t_a_b as the line concatenation character.
  42.           The list is used circularly, i.e., when exhausted, it
  43.           is reused.  In parallel merging (i.e., no -s option),
  44.           the lines from the last file are always terminated with
  45.           a new-line character, not from the _l_i_s_t.  The list may
  46.           contain the special escape sequences: \n (new-line), \t
  47.           (tab), \\ (backslash), and \0 (empty string, not a null
  48.           character).  Quoting may be necessary, if characters
  49.           have special meaning to the shell (e.g., to get one
  50.           backslash, use "" -_d"_\_\_\_\" ).
  51.  
  52.      -s   Merge subsequent lines rather than one from each input
  53.           file.  Use _t_a_b for concatenation, unless a _l_i_s_t is
  54.           specified with -d option.  Regardless of the _l_i_s_t, the
  55.           very last character of the file is forced to be a new-
  56.           line.
  57.  
  58.      -    May be used in place of any file name, to read a line
  59.           from the standard input.  (There is no prompting).
  60.  
  61.  
  62.  
  63. Printed 3/5/87                                                  1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PASTE(1)            UNIX Programmer's Manual             PASTE(1)
  71.  
  72.  
  73.  
  74. EXAMPLES
  75.      ls | paste -d" " -
  76.                     list directory in one column
  77.  
  78.      ls | paste - - - -
  79.                     list directory in four columns
  80.  
  81.      paste -s -d"\t\n" file
  82.                     combine pairs of lines into lines
  83.  
  84. SEE ALSO
  85.      cut(1), grep(1), pr(1).
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Printed 3/5/87                                                  2
  130.  
  131.  
  132.  
  133.